<div id="view_import">
<div>
	<div class="span-15 column">
		<b>Informations</b>
	</div>
	<div class="span-2 column last">
		<?php echo CHtml::link('Edit','#',array('id'=>'edit_import'));?>
	</div>
</div>
<hr />
<?php $this->widget('zii.widgets.CDetailView', array(
	'data'=>$model,
	'attributes'=>array(
		'eta:date:Date arrival',	
		'jobno:text:Referrence No.',
		'pol:text:Port of loading',
		'freight_info:text:Vessel/Freight info',
		'pod:text:Port of discharge',
		'issuer.cname:text:AWB/BL issuing carrier',
		'clearer.cname:text:Clearing agent'
	),
)); ?>
</div>
<?php
$cs = Yii::app()->ClientScript;
$ImportUrl = CHtml::normalizeUrl(array('import/update','id'=>$model->id));
$script =<<<EOD
$('#edit_import').click(function(){
	var original = $(this).parents('div#view_import');
	$(original).detach();
	$('#import').subcontent({url:'$ImportUrl',afterShow:function(){
		$('#cancel').replaceWith('<input name="cancel" id="cargo_cancel" type="button" value="Cancel" class="ui-button ui-widget ui-state-default ui-corner-all" role="button" aria-disabled="false">');
		$('#cargo_cancel').click(function(){
			$('#import').html($(original));
		});
	}});
	return false;
});
EOD;
$cs->registerScript('import#create#form',$script);
?>